package com.example.myapplication.model;

import com.example.myapplication.base.BaseModel;
import com.example.myapplication.bean.NavigationBean;
import com.example.myapplication.bean.QuestionsBean;
import com.example.myapplication.net.ResultCallBack;
import com.example.myapplication.util.HttpUtil;
import com.example.myapplication.util.ResultSubscriber;
import com.example.myapplication.util.RxUtils;

public class NavigationModel extends BaseModel {
    public void getNavigationData(final ResultCallBack<NavigationBean> resultCallBack) {
        addDisposable(
                HttpUtil.getInstance()
                .getNavigationService()
                .getData()
                .compose(RxUtils.<NavigationBean>ttFlowableTransformer())
                .subscribeWith(new ResultSubscriber<NavigationBean>() {
                    @Override
                    public void onNext(NavigationBean navigationBean) {
                        resultCallBack.onSuccess(navigationBean);
                    }
                })
        );

    }
}
